FROM {{ namespace }}/{{ infra_image_prefix }}prometheus-base:{{ tag }}
{% block labels %}
LABEL maintainer="{{ maintainer }}" name="{{ image_name }}" build-date="{{ build_date }}"
{% endblock %}

{% block prometheus_alertmanager_header %}{% endblock %}

{% block prometheus_alertmanager_repository_version %}
ARG prometheus_alertmanager_version=0.23.0
{% endblock %}

{% block prometheus_alertmanager_install %}
ARG prometheus_alertmanager_archive=alertmanager-${prometheus_alertmanager_version}.linux-{{debian_arch}}.tar.gz
ARG prometheus_alertmanager_download_url=https://github.com/prometheus/alertmanager/releases/download/v${prometheus_alertmanager_version}/${prometheus_alertmanager_archive}
RUN cd /tmp && curl -o ${prometheus_alertmanager_archive} ${prometheus_alertmanager_download_url} \
    && curl https://github.com/prometheus/alertmanager/releases/download/v${prometheus_alertmanager_version}/sha256sums.txt -w '' | sha256sum --ignore-missing -c - \
    && tar xvf /tmp/${prometheus_alertmanager_archive} -C /opt/ \
    && rm -f /tmp/${prometheus_alertmanager_archive} \
    && ln -s /opt/alertmanager* /opt/prometheus_alertmanager
{% endblock %}

{% block prometheus_alertmanager_footer %}{% endblock %}
{% block footer %}{% endblock %}

USER prometheus
